//
//  ZHCZViewController.m
//  firstpoint
//
//  Created by 泽中 on 2017/7/19.
//  Copyright © 2017年 xzcysoft. All rights reserved.
//

#import "ZHCZViewController.h"
#import "BinDingTextView.h"
#import "ChongZhiFangShiView.h"
@interface ZHCZViewController ()
{
UIButton*yuanbaoBtn;
UIButton*jinbiBtn;
    UIView*yuanbaoView;
    UIView*jinbiView;
    
    UITextField*yuanbaoText;
    UITextField*jinbiText;
}
@end

@implementation ZHCZViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"账户充值";
    self.view.backgroundColor=LRRGBColor(235, 240, 242);

    [self setButton];
    [self setView];
    
}
-(void)setView
{   //元宝
    yuanbaoView=[[UIView alloc]initWithFrame:CGRectMake(20, 130, width_screen-40, 350)];
    yuanbaoView.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:yuanbaoView];
    
    BinDingTextView*duihuanNumView=[[BinDingTextView alloc]initWithFrame:CGRectMake(20, 20, yuanbaoView.mj_w-40, 60)];
    duihuanNumView.textField.placeholder=@"请输入充值的金额";
    duihuanNumView.textField.font=[UIFont systemFontOfSize:25];
    duihuanNumView.titleLab.text=@"充值金额";
    [yuanbaoView addSubview:duihuanNumView];
    
    ChongZhiFangShiView*wechatView=[[ChongZhiFangShiView alloc]initWithFrame:CGRectMake(0, 110, yuanbaoView.mj_w, 50)];
    wechatView.imgView.image=[UIImage imageNamed:@"shdwx"];
    wechatView.label.text=@"微信支付";
    [wechatView.button setImage:[UIImage imageNamed:@"gwcwxz"] forState:0];
    [yuanbaoView addSubview:wechatView];
    
    ChongZhiFangShiView*aliPayView=[[ChongZhiFangShiView alloc]initWithFrame:CGRectMake(0, 160, yuanbaoView.mj_w, 50)];
    aliPayView.imgView.image=[UIImage imageNamed:@"shdbdzfb"];
    aliPayView.label.text=@"支付宝支付";
    [aliPayView.button setImage:[UIImage imageNamed:@"gwcwxz"] forState:0];
    [yuanbaoView addSubview:aliPayView];

   
    UIButton*duihuanYuanBaoButton=[UIButton buttonWithType:UIButtonTypeCustom];
    duihuanYuanBaoButton.frame=CGRectMake(20, aliPayView.mj_h+aliPayView.mj_y+30, yuanbaoView.mj_w-40, 50);
    duihuanYuanBaoButton.backgroundColor=[UIColor orangeColor];
    [duihuanYuanBaoButton setTitle:@"确认充值" forState:0];
    duihuanYuanBaoButton.layer.cornerRadius=5;
    [yuanbaoView addSubview:duihuanYuanBaoButton];
    
    //金币
    jinbiView=[[UIView alloc]initWithFrame:CGRectMake(20, 130, width_screen-40, 350)];
    jinbiView.hidden=YES;
    jinbiView.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:jinbiView];
    
    
    BinDingTextView*duihuanNumView2=[[BinDingTextView alloc]initWithFrame:CGRectMake(20, 20, yuanbaoView.mj_w-40, 60)];
    duihuanNumView2.textField.placeholder=@"金币";
    duihuanNumView2.textField.font=[UIFont systemFontOfSize:25];

    duihuanNumView2.titleLab.text=@"我要兑换";
    [jinbiView addSubview:duihuanNumView2];
    
    
    
    ChongZhiFangShiView*wechatView2=[[ChongZhiFangShiView alloc]initWithFrame:CGRectMake(0, 110, yuanbaoView.mj_w, 50)];
    wechatView2.imgView.image=[UIImage imageNamed:@"shdwx"];
    wechatView2.label.text=@"微信支付";
    [wechatView2.button setImage:[UIImage imageNamed:@"gwcwxz"] forState:0];
    [jinbiView addSubview:wechatView2];
    
    ChongZhiFangShiView*aliPayView2=[[ChongZhiFangShiView alloc]initWithFrame:CGRectMake(0, 160, yuanbaoView.mj_w, 50)];
    aliPayView2.imgView.image=[UIImage imageNamed:@"shdbdzfb"];
    aliPayView2.label.text=@"支付宝支付";
    [aliPayView2.button setImage:[UIImage imageNamed:@"gwcwxz"] forState:0];
    [jinbiView addSubview:aliPayView2];

   
    UIButton*duihuanJinBiButton=[UIButton buttonWithType:UIButtonTypeCustom];
    duihuanJinBiButton.frame=CGRectMake(20, aliPayView2.mj_h+aliPayView2.mj_y+30, yuanbaoView.mj_w-40, 50);
    duihuanJinBiButton.backgroundColor=[UIColor orangeColor];
    [duihuanJinBiButton setTitle:@"确认充值" forState:0];
    duihuanJinBiButton.layer.cornerRadius=5;
    [jinbiView addSubview:duihuanJinBiButton];
    
}

-(void)setButton
{
    yuanbaoBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    yuanbaoBtn.backgroundColor=LRRGBColor(23, 146, 211);
    [yuanbaoBtn setTitle:@"兑换元宝" forState:0];
    yuanbaoBtn.frame=CGRectMake(20, 84, (width_screen-40)/2, 45);
    [yuanbaoBtn addTarget:self action:@selector(yuanbaoClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:yuanbaoBtn];
    
    jinbiBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    [jinbiBtn addTarget:self action:@selector(jinbiClick) forControlEvents:UIControlEventTouchUpInside];
    
    jinbiBtn.backgroundColor=[UIColor whiteColor];
    [jinbiBtn setTitle:@"兑换金币" forState:0];
    [jinbiBtn setTitleColor:LRRGBColor(23, 146, 211) forState:0];
    jinbiBtn.frame=CGRectMake(20+(width_screen-40)/2, 84, (width_screen-40)/2, 45);
    [self.view addSubview:jinbiBtn];
}
-(void)yuanbaoClick
{
    yuanbaoBtn.backgroundColor=LRRGBColor(23, 146, 211);
    [yuanbaoBtn setTitleColor:[UIColor whiteColor] forState:0];
    jinbiBtn.backgroundColor=[UIColor whiteColor];
    [jinbiBtn setTitleColor:LRRGBColor(23, 146, 211) forState:0];
    jinbiView.hidden=YES;
    yuanbaoView.hidden=NO;
}

-(void)jinbiClick
{ jinbiBtn.backgroundColor=LRRGBColor(23, 146, 211);
    [jinbiBtn setTitleColor:[UIColor whiteColor] forState:0];
    yuanbaoBtn.backgroundColor=[UIColor whiteColor];
    [yuanbaoBtn setTitleColor:LRRGBColor(23, 146, 211) forState:0];
    jinbiView.hidden=NO;
    yuanbaoView.hidden=YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
